(part 2 of 4)


HOW TO LOAD EOS8 rev.7.


EOS8  rev.7 is currently part of a modified SmartBASIC 2.0  which 
lacks all the EXTMEM features. (I did it this way as a quick-and-
dirty loader,  also to test the logical-to-physical remapping  of 
PR#2/PR#4/IN#4.)  Put  the disk in any drive and pull the  reset. 
Once SmartBASIC 2.0 comes up, you can put any other bootable disk 
in  the  drive  and CALL 64560 (_EOS_START).  The  disk  will  be 
booted, but the EOS8 will still be in effect.

Since  there aren't yet any serial port init routines,  you  must 
use  some other program to init them *BEFORE* you load  EOS8,  or 
else boot SB1.x under EOS8 and use the SERIAL command. My primary 
testing tool has been SB1.x,  because it lets me do EOS  function 
calls  directly  via register variable setups and  CALL  EOS(nn). 
Also,  the  default value at USER_BASEPORT is 0 (no serial port). 
You will have to POKE 65206,baseport in order to use device 14 as 
a non_ADAMnet serial port, where baseport maps as:

        SER68_PORT       EQU    68
        SER76_PORT       EQU    76
        SER84_PORT       EQU    84
        SER92_PORT       EQU    92
        SER_MIB21_PORT   EQU    24
        SER_MIB22_PORT   EQU    16

The current logical-to-physical mapping is:

        device 2 (ADAM printer)        --->  USERPAR_ID
        device 13 (Coleco Centronics)  --->  USERPAR_ID
        device 14 (Coleco RS-232)      --->  USERSER_ID
        device 24 (tape 2)             --->  USERHD_ID

*****************************************************************

NEW GLOBAL ENTRY POINTS IN EOS8 rev.7

58343   HD_OVERLAY:     
        HD_CURRENT_VOLUME:
                DS 1
58344   HD_VOL_OFFSET_TABLE:
                DS 16

;note:  the following 4 JPs are for *INTERNAL EOS USE ONLY*, but
are; fixed entry points which the overlay programmer must provide.

58360   HD_STATUS:                       ;get dummy DCB status
                JP __HD_STATUS
58363   HD_RESET:                        ;park heads
                JP __HD_RESET
58366   HD_WRITE:                        ;write 1 block
                JP __HD_WRITE
58369   HD_READ:                         ;read 1 block
                JP __HD_READ

58372   USER_HD:                         ;code for HD type
                DS 1
[...]

;SECONDARY EOS JUMP TABLE.;  This is for the additional EOS 
function calls.  The bottom of the; table is fixed, so new 
entries must be added to the *BEGINNING*.  Do *NOT*; delete any
entries!  Also, make sure that the JUMP2_COUNT variable is
;updated whenever you add jump table entries!

JUMP2_COUNT     EQU     9

64484   _GET_HW_CLOCK      EQU  $    ;read hardware clock time to
system clock
        JP     __GET_HW_CLOCK

64487   _SET_HW_CLOCK      EQU  $    ;write system clock time to
hardware clock
        JP     __SET_HW_CLOCK
64490   _UPDATE_NMI_CLOCK  EQU  $    ;system clock tick (every
NMI)
        JP     __UPDATE_NMI_CLOCK
64493   _WRITE_PAR         EQU  $    ;write character to parallel
port
        JP     __WRITE_PAR
64496   _READ_SER          EQU  $    ;read character from serial
port
        JP     __READ_SER
64499   _WRITE_SER         EQU  $    ;write character to serial
port
        JP     __WRITE_SER
64502   _INIT_SER          EQU  $    ;initialize serial port
        JP     __INIT_SER
using a
                                     ;logical devic
        JP     __GET_PHYS
4508   _SET_PHYS          EQU  $    ;specify the physical device
to be used
                                     ;by a logical device
        JP     __SET_PHYS

; *** _SET_PHYS IS THE LAST ENTRY!! ***
; *** DO NOT ADD TO THE END OF THIS TABLE!! ***

[...]

65196   TRIGGER_CHAR:
        DS 

65197   USR_DFND_RTN:
        DS 2
65199   NUM_FCBS:

        DS 


;begin EOS8 global RAM


65200   EOS_60TH:
        DS 1            ;RFD
65201   EOS_SECOND:
        DS 1            ;RFD
65202   EOS_MINUTE:
        DS 1            ;RFD
65203   EOS_HOUR:
        DS 1            ;RFD
65204   EOS_WEEKDAY:
        DS 1            ;RFD

65205   INTERRUPT_FLAGS:              ;store INT/NMI flags for
VRAM routines
        DS 1            ;RFD

65206   USER_BASEPORT:ns
65207   USER_SER_STATS:               ;in case we emulate ADAMnet
serial board
        DS 6            ;RFD          ;initializations (hold
                                       parameters)
        DS 3            ;added by RFD to reserve space

65216   PCB:
        DS P_SIZE
65220   DCBS:            ;only 12 real ADAMnet devices permitted
        DS 12*D_SIZE

;****************************************************************

DUMMY_DCBS:; Note:  these will *NOT* be relocated if the PCB is
;relocated!  So if you application is switching to XRAM or
;ROM up here, you will *LOSE* these devices!!!

;     Note 2:  these are *NOT* user entry points!  This is for
reference  ;*ONLY*!!  Always  access  the  DCBs  indirectly,  via 
_FIND_DCB.  The  parallel ;DCB is currently stored at  DCB_IMAGE, 
but this is subject to change.

65472   SERIAL_DCB:
        DS 21
65493   RAMDISK_DCB:
        DS 21
65514   HARDDISK12_DCB:
        DS 21
65535   RESERVED_BYTE:
        DS 1

*****************************************************************


III.  Universal Non-ADAMnet Serial and Parallel Drivers.


Here is commented source code for drivers for the Orphanware  and 
MIB2 serial ports and the Orphanware parallel printer port. These 
were  written to be a "universal" module--just include it in your 
program,  and  it can support all 6 serial ports as well  as  the 
printer port. For the serial ports, the serial baseport to use is 
passed  in the C register;  characters are passed in the A regis-
ter;  the Z flag reflects the status; if an error occurred, A has 
the error code.

The  other great advantage of this code is that it  implements  a 
10-second  timeout.  If  the  I/O is not  successfully  completed 
within 10 seconds (software loop timing assuming 4 mHz  Z80),  it 
times  out  and  returns an error code.  This  prevents  infinite 
polling  loops which require a hard reboot to get out of  if  you 
specify  the wrong port,  or if a printer or modem isn't on-line. 
Feel  free  to use this code.  Note the conditional  assembly  of 
tests  for  overrun,  framing,  or parity errors for  the  serial 
drivers.  I left them conditional in EOS-8 to save some space  in 
EOS  RAM;  they are active in the SmartBASIC 1.x code.  If  these 
errors  occur,  the only way to clear them is to reinitialize the 
serial port.

I  haven't  included universal serial  port  initialization  code 
here. It's present in the boot for the ADAMserve boot disk, again 
requiring  the serial baseport passed in the C register,  and the 
other  serial port parameters (bitrate,  parity,  number of  stop 
bits) passed in other registers.  I can post this code at a later 
time.

;****************************************************************


-Rich


